//
//  PSFilterUtil.m
//  PrefCore
//
//  Created by SERGEY KALINICHENKO on 10/14/14.
//  Copyright (c) 2014 Play-on-smart. All rights reserved.
//

#import "PSFilterUtil.h"

PSHandHash PSFilterGetLowestCandidates(PSHandHash candidates) {
    PSHandHash res = 0;
    for (int i = 0 ; i != PS_CARD_SUIT_RISING_LEN ; i++) {
        PSCardSuit s = PSCardSuitRising[i];
        PSCardRank lowest = PSCardSetLowestRank(PSHandGetSuit(candidates, s));
        if (lowest != kRankNull) {
            res = PSHandAddCard(res, [PSCard cardWithSuit:s andRank:lowest]);
        }
    }
    return res;
}

